<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:f="livcos.org/ns/xslt/function"
	exclude-result-prefixes="f">

	<xsl:import href="base.xsl" />
	
	<xsl:template match="/">
		<xsl:variable name="url" select="$testUrls[@id = 'url_1']"/>
		<xsl:variable name="userLogin" select="$testLogins[@id = 'login_5']"/>
		<xsl:variable name="login">
			<http-request method="POST">
				<param name="Bugzilla_login"><xsl:value-of select="$userLogin/@name"/></param>
				<param name="Bugzilla_password"><xsl:value-of select="$userLogin/@password"/></param>
			</http-request>
		</xsl:variable>
		<test>
			<xsl:variable name="loginResponse"
				select="f:request(concat($url, '/index.cgi'), $login)"/>
			<xsl:copy-of select="$loginResponse"/>
			<xsl:variable name="get">
				<http-request>
					<param name="cmdtype">runnamed</param>
					<param name="namedcmd">Open</param>
					<param name="ctype">atom</param>
					<cookie name="Bugzilla_login">2</cookie>
					<cookie name="Bugzilla_logincookie">
						<xsl:value-of select="$loginResponse/cookie/Bugzilla_logincookie"/>
					</cookie>
				</http-request>
			</xsl:variable>
			<xsl:copy-of select="$get"/>
			<xsl:copy-of select="f:request(concat($url, '/buglist.cgi'), $get)"/>
			<xsl:variable name="get2">
				<http-request>
					<param name="cmdtype">runnamed</param>
					<param name="namedcmd">Open</param>
					<param name="ctype">csv</param>
					<cookie name="Bugzilla_login">2</cookie>
					<cookie name="Bugzilla_logincookie">
						<xsl:value-of select="$loginResponse/cookie/Bugzilla_logincookie"/>
					</cookie>
				</http-request>
			</xsl:variable>
			<xsl:copy-of select="$get2"/>
			<xsl:copy-of select="f:request(concat($url, '/buglist.cgi'), $get2)"/>
		</test>
	</xsl:template>
	
</xsl:stylesheet>